/************************************************************************
* Game class, the top level structure which handle MVC system
* Author : Shaolan
* Version : 1.0
* Website : http://shaolan.net
*/
#include "game.hpp"

using namespace std;

// ***********************************************************************************************************************************
// Public Constructor
Game::Game(){
	model = new Model(18,11);
	view = new View(model);
	controller = new Controller(model);
}

// ***********************************************************************************************************************************
// Public Destructor
Game::~Game(){
	delete controller;
	delete view;
	delete model;
}

// ***********************************************************************************************************************************
// Getters
Model * Game::getModel() const { return model; }
View * Game::getView() const { return view; }
Controller * Game::getController() const { return controller; }

// ***********************************************************************************************************************************
// Setters
void Game::setModel(Model *m) { model = m; } 
void Game::setView(View * v) {view = v; }
void Game::setController(Controller * c) { controller = c; }

// ***********************************************************************************************************************************
// Run method
bool Game::run(){
	model->popNextItem();
	while (controller->update()){ 
		view->draw();
	}
	return true;
}